[Snyk] Upgrade remark-flexible-containers from 1.0.6 to 1.2.1 #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Snyk has created this PR to upgrade remark-flexible-containers from 1.0.6 to 1.2.1.
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
The recommended version is 4 versions ahead of your current version.
The recommended version was released a year ago.
Issues fixed by the recommended upgrade:
SNYK-JS-AXIOS-6671926
Release notes
Package name: remark-flexible-containers
The changes made by @ talatkuyuk
title
should break the optiontitle: () => null
, and the title should take placeRelease notes and changes made by @ talatkuyuk
package-lock.json
on behalf of npm clean install in the github actionstitleProperties
andcontainerProperties
are not allowed to haveclassName
in the returned object@ types/mdast
is extended with newContainer
typeAdded Support for Specific Identifiers
::: [type] [{tagname#id.classname}] [title] [{tagname#id.classname}]
Now, the
remark-flexible-containers
supports syntax for specific identifiers (tagname
,id
,classnames
) for individualcontainer
andtitle
node. For example:::: info {section#foo.myclass} Title Of Information {span#baz.someclass} <!-- content --> :::
The identifiers (
tagname
,id
,classnames
) must be inside curly braces.Syntax is very simple.
tagname
is to be compatible HTML tag name, and may present only once,id
is to start with hash#
, and may present only once,classnames
are to start with dot.
, and may present many.There are two groups of identifiers. Each group is optional, may present or not.
The first group of identifiers (just after the
type
) is forcontainer
node.The second group of identifiers (just after the
title
) is fortitle
node.Here are some example usages. For simplicity, I omitted the container contents and ending syntax, just put the beginning syntax in the examples. All are valid usage for specific identifiers.
These identifiers can be placed as all three, any two, or just any of them in the desired order, with or without a space between them. This is why the "flexibility" term comes from.
Release notes and the changes made by @ talatkuyuk
removed inconsistencies in the outputs whether there is an empty line or not
::: info :::
and
:::
Now, both produces the output without
<p>
inside the container,Fixed a bug
if a
break
node is the first child of a paragraph within the container, thebreak
node is removed.Fixed a bug for the block-level html elements in markdown files (not related with mdx files)
Block-level html elements was causing a bug if the
:::
closing container sign is just after the that element closing tag.For the fix, I added another
visit
function for thehtml
nodes in the AST that if a html node.value ends with "\n:::", remove and carry it into a new paragraph.Now, we don't need to put an empty line after the block-level html elements like
<p>
tag in the container, before it was needed an empty line to work with "markdown" documents.Release notes and the changes made by @ talatkuyuk
.npmrc
filepackage.json
and thetsconfig.json
README.md
having at least node version 16+ts-jest
test environment by addingmoduleResolution
callback function
for thetitle
option (breaking change !!!)Before, the
title
option wasnull | undefined
. If you wanted not to add atitle
node, the option wastitle: null
.Now, the
title
option is a callback function(type?: string, title?: string) => string | null | undefined
. If you want not to add atitle
node, the option istitle: () => null
. With that callback function, you are able to change the titles according to your logic.callback function
option for the TagName and ClassName options in addition tostring
optionIt will also provides you to define dynamic tag names and class names.
Relesae Notes:
src
directory into files in package.json for source map supportImportant
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information: